/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2013
 */

package com.smg.community.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.smg.community.dao.*;
import com.smg.community.service.*;
import com.smg.community.util.ProjectUtil;
import com.smg.community.vo.query.*;

/**
 * @author badqiu email:badqiu(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


public class SmgMember extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "SmgMember";
	public static final String ALIAS_MEMBER_ID = "memberId";
	public static final String ALIAS_LOGIN_NAME = "loginName";
	public static final String ALIAS_PASSWORD = "password";
	public static final String ALIAS_SIGNATURE = "signature";
	public static final String ALIAS_HEAD_IMAGE = "headImage";
	public static final String ALIAS_SEX = "sex";
	public static final String ALIAS_TOPIC_COUNT = "topicCount";
	public static final String ALIAS_EMAIL = "email";
	public static final String ALIAS_IS_EMAIL_VERIFY = "isEmailVerify";
	public static final String ALIAS_MOBILE_NUMBER = "mobileNumber";
	public static final String ALIAS_IS_MOBILE_VERIFY = "isMobileVerify";
	public static final String ALIAS_REG_SOURCE = "regSource";
	public static final String ALIAS_APP_SOURCE = "appSource";
	public static final String ALIAS_APP_VERSION = "appVersion";
	public static final String ALIAS_THIRD_PARTY_TOKEN = "thirdPartyToken";
	public static final String ALIAS_LAST_LOGIN_DATE = "lastLoginDate";
	public static final String ALIAS_REG_DATE = "regDate";
	
	//date formats
	public static final String FORMAT_LAST_LOGIN_DATE = DATE_FORMAT;
	public static final String FORMAT_REG_DATE = DATE_FORMAT;
	
	
	private String nickNameFirstChar;
	public String getNickNameFirstChar() {
		return nickNameFirstChar;
	}

	public void setNickNameFirstChar(String nickNameFirstChar) {
		this.nickNameFirstChar = nickNameFirstChar;
	}
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * memberId       db_column: memberId 
     */	
	
	private java.lang.Integer memberId;
    /**
     * loginName       db_column: loginName 
     */	
	private java.lang.String loginName;
    /**
     * password       db_column: password 
     */	
	private java.lang.String password;
    /**
     * signature       db_column: signature 
     */	
	private java.lang.String signature;
    /**
     * headImage       db_column: headImage 
     */	
	private java.lang.String headImage;
    /**
     * sex       db_column: sex 
     */	
	private java.lang.String sex;
    /**
     * topicCount       db_column: topicCount 
     */	
	
	private java.lang.Integer topicCount;
    /**
     * email       db_column: email 
     */	
	private java.lang.String email;
    /**
     * isEmailVerify       db_column: isEmailVerify 
     */	
	private java.lang.Integer isEmailVerify;
    /**
     * mobileNumber       db_column: mobileNumber 
     */	
	private java.lang.String mobileNumber;
    /**
     * isMobileVerify       db_column: isMobileVerify 
     */	
	
	private java.lang.Integer isMobileVerify;
    /**
     * regSource       db_column: regSource 
     */	
	private java.lang.String regSource;
    /**
     * appSource       db_column: appSource 
     */	
	private java.lang.String appSource;
    /**
     * appVersion       db_column: appVersion 
     */	
	private java.lang.String appVersion;
    /**
     * thirdPartyToken       db_column: thirdPartyToken 
     */	
	private java.lang.String thirdPartyToken;
    /**
     * lastLoginDate       db_column: lastLoginDate 
     */	
	
	private java.util.Date lastLoginDate;
    /**
     * regDate       db_column: regDate 
     */	
	
	private java.util.Date regDate;
	
	private int focusCount;
	//columns END
	
	private int isStaff;
	
	private String constellation;
	
	public String getConstellation() {
		constellation = ProjectUtil.date2Constellation(birthMonth,birthDay);
		return constellation;
	}

	public void setConstellation(String constellation) {
		this.constellation = constellation;
	}
	
	public int getIsStaff() {
		return isStaff;
	}

	public void setIsStaff(int isStaff) {
		this.isStaff = isStaff;
	}

	public int getFocusCount() {
		return focusCount;
	}

	public void setFocusCount(int focusCount) {
		this.focusCount = focusCount;
	}
	private String nickName;
	
	
	private int birthYear;
	
	private int birthMonth;
	
	private int birthDay;
	
	
	private Date focusDate;
	
	private String yearAfter;
	
	public String getYearAfter() {
		String temp = getBirthYear() +"" ;
		try {
		
			yearAfter 	= temp.charAt(2)+"0后";
		}catch(Exception e){
			yearAfter =  "80后";
		}
		return yearAfter;
	
	}

	public void setYearAfter(String yearAfter) {
		this.yearAfter = yearAfter;
	}

	public Date getFocusDate() {
		return focusDate;
	}

	public void setFocusDate(Date focusDate) {
		this.focusDate = focusDate;
	}

	public int getBirthYear() {
		if ( birthYear == 0){
			birthYear = 1980 ;
		}
		return birthYear;
	}

	public void setBirthYear(int birthYear) {
		this.birthYear = birthYear;
	}

	public int getBirthMonth() {
		if ( birthMonth == 0){
			birthMonth = 1;
		}
		return birthMonth;
	}

	public void setBirthMonth(int birthMonth) {
		this.birthMonth = birthMonth;
	}

	public int getBirthDay() {
		if ( birthDay == 0){
			birthDay = 1 ;
		}
		return birthDay;
	}

	public void setBirthDay(int birthDay) {
		this.birthDay = birthDay;
	}

	private int isNewMember;

	private int fansCount;
	
	private int totalPoint;
	
	private int avilablePoint;
	
	private int visitCount;
	
	public int getVisitCount() {
		return visitCount;
	}

	public void setVisitCount(int visitCount) {
		this.visitCount = visitCount;
	}

	public int getTotalPoint() {
		return totalPoint;
	}

	public void setTotalPoint(int totalPoint) {
		this.totalPoint = totalPoint;
	}


	public int getAvilablePoint() {
		return avilablePoint;
	}

	public void setAvilablePoint(int avilablePoint) {
		this.avilablePoint = avilablePoint;
	}

	public int getFansCount() {
		return fansCount;
	}

	public void setFansCount(int fansCount) {
		this.fansCount = fansCount;
	}

	public int getIsNewMember() {
		return isNewMember;
	}

	public SmgMember(){
	}

	public SmgMember(
		java.lang.Integer memberId
	){
		this.memberId = memberId;
	}

	public void setMemberId(java.lang.Integer value) {
		this.memberId = value;
	}
	
	public java.lang.Integer getMemberId() {
		return this.memberId;
	}
	public void setLoginName(java.lang.String value) {
		this.loginName = value;
	}
	
	public java.lang.String getLoginName() {
		return this.loginName;
	}
	public void setPassword(java.lang.String value) {
		this.password = value;
	}
	
	public java.lang.String getPassword() {
		return this.password;
	}
	public void setSignature(java.lang.String value) {
		this.signature = value;
	}
	
	public java.lang.String getSignature() {
		if ( signature == null ||signature.equals("")){
			signature = "我才懒得写什么签名.";
		}
		return this.signature;
	}
	public void setHeadImage(java.lang.String value) {
		this.headImage = value;
	}
	
	public java.lang.String getHeadImage() {
		if  ( headImage == null || headImage.trim().equals("")){
			headImage = "http://img3.ddmapimg.com/crm/2013-05-14/233331780.jpg";
		}
		if ( sex != null){
			if ( sex.equals("m")){
				
			}else if (sex.equals("w")){
			}
		}
			
		return this.headImage;
	}
	public void setSex(java.lang.String value) {
		this.sex = value;
	}
	
	public java.lang.String getSex() {
		return this.sex==null?"":this.sex;
	}
	public void setTopicCount(java.lang.Integer value) {
		this.topicCount = value;
	}
	
	public java.lang.Integer getTopicCount() {
		return this.topicCount;
	}
	public void setEmail(java.lang.String value) {
		this.email = value;
	}
	
	public java.lang.String getEmail() {
		return this.email;
	}
	public void setIsEmailVerify(java.lang.Integer value) {
		this.isEmailVerify = value;
	}
	
	public java.lang.Integer getIsEmailVerify() {
		return this.isEmailVerify;
	}
	public void setMobileNumber(java.lang.String value) {
		this.mobileNumber = value;
	}
	
	public java.lang.String getMobileNumber() {
		return this.mobileNumber;
	}
	public void setIsMobileVerify(java.lang.Integer value) {
		this.isMobileVerify = value;
	}
	
	public java.lang.Integer getIsMobileVerify() {
		return this.isMobileVerify;
	}
	public void setRegSource(java.lang.String value) {
		this.regSource = value;
	}
	
	public java.lang.String getRegSource() {
		return this.regSource;
	}
	public void setAppSource(java.lang.String value) {
		this.appSource = value;
	}
	
	public java.lang.String getAppSource() {
		return this.appSource;
	}
	public void setAppVersion(java.lang.String value) {
		this.appVersion = value;
	}
	
	public java.lang.String getAppVersion() {
		return this.appVersion;
	}
	public void setThirdPartyToken(java.lang.String value) {
		this.thirdPartyToken = value;
	}
	
	public java.lang.String getThirdPartyToken() {
		return this.thirdPartyToken;
	}
	public String getLastLoginDateString() {
		return DateConvertUtils.format(getLastLoginDate(), FORMAT_LAST_LOGIN_DATE);
	}
	public void setLastLoginDateString(String value) {
		setLastLoginDate(DateConvertUtils.parse(value, FORMAT_LAST_LOGIN_DATE,java.util.Date.class));
	}
	
	public void setLastLoginDate(java.util.Date value) {
		this.lastLoginDate = value;
	}
	
	public java.util.Date getLastLoginDate() {
		return this.lastLoginDate;
	}
	public String getRegDateString() {
		return DateConvertUtils.format(getRegDate(), FORMAT_REG_DATE);
	}
	public void setRegDateString(String value) {
		setRegDate(DateConvertUtils.parse(value, FORMAT_REG_DATE,java.util.Date.class));
	}
	
	public void setRegDate(java.util.Date value) {
		this.regDate = value;
	}
	
	public java.util.Date getRegDate() {
		return this.regDate;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("MemberId",getMemberId())
			.append("LoginName",getLoginName())
			.append("Password",getPassword())
			.append("Signature",getSignature())
			.append("HeadImage",getHeadImage())
			.append("Sex",getSex())
			.append("TopicCount",getTopicCount())
			.append("Email",getEmail())
			.append("IsEmailVerify",getIsEmailVerify())
			.append("MobileNumber",getMobileNumber())
			.append("IsMobileVerify",getIsMobileVerify())
			.append("RegSource",getRegSource())
			.append("AppSource",getAppSource())
			.append("AppVersion",getAppVersion())
			.append("ThirdPartyToken",getThirdPartyToken())
			.append("LastLoginDate",getLastLoginDate())
			.append("RegDate",getRegDate())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getMemberId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof SmgMember == false) return false;
		if(this == obj) return true;
		SmgMember other = (SmgMember)obj;
		return new EqualsBuilder()
			.append(getMemberId(),other.getMemberId())
			.isEquals();
	}

	/**
	 * @return the nickName
	 */
	public String getNickName() {
		return nickName;
	}

	/**
	 * @param nickName the nickName to set
	 */
	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public void setIsNewMember(int isNewMember) {
		this.isNewMember = isNewMember;
	}
}

